/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import common.ArticuloEnvt;
import common.ArticuloStock;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import model.xml.ParseXML;

/**
 *
 * @author Jhonny
 */
public class ModelRecibirENVT extends Model{

    public ModelRecibirENVT(ModelMain model) {

    }

    public List<ArticuloEnvt> getArticulosENVT(String path) throws FileNotFoundException, IOException {
        ParseXML parse = new ParseXML();
        List<ArticuloEnvt> list = null;
        List<ArticuloStock> stocks=null;
        stocks = parse.getArticulosENVT(path);
        if(stocks!=null){
            ArticuloEnvt articulo=null;
            list = new LinkedList<ArticuloEnvt>();
            for (ArticuloStock articuloStock : stocks) {
                articulo = new ArticuloEnvt();
                articulo.setReferencia(articuloStock.getReferencia());
                articulo.setCantidadRecibida(articuloStock.getStock());
                list.add(articulo);
            }
        }
        return list;
    }

    

    public void recibirENVT(List<ArticuloStock> articulos) {
        throw new UnsupportedOperationException("Not yet implemented");
    }

}
